﻿using System;
using System .Collections .Generic;
using System .Linq;
using System .Web;
using System .Data;
using System .ComponentModel;
using System .ComponentModel .DataAnnotations;

namespace VehicleManagement .Models
    {
    //    ----------司机表--------司机ID属性和申请审批表中的司机ID一致
    //CREATE	TABLE DriverInfo
    //(
    //DriverID int  IDENTITY(1,1) primary key,
    //Driver_name varchar(18)  not null,
    //Driver_image varchar(100),
    //Email varchar(30),
    //Sex  char(2),
    //Age  int,
    //Telephone varchar(18),
    //Fam_addr varchar(30),
    //Free_busy bit default(0),
    //isMane bit default(0),
    //Driver_linceID varchar(18) unique not null ,
    //LinceID  varchar(18) unique not null,
    //Lince_start datetime not null,
    //Lince_type varchar(18) not null,
    //Lincecheck_time datetime not null,
    //Remark  varchar(100)
    //)
    public class DriverInfo
        {
            [DisplayName("司机编号")]
            public int DriverID { get; set; }


            [DisplayName("司机号码")]
            //  [Required(ErrorMessage="请输入1到18位数字或字母")]
            //  [RegularExpression(@"^[-\da-zA-Z]{1,18}$", ErrorMessage = "请输入1到18位数字或字母")]
            public virtual string DriverNumber { get; set; }


            [DisplayName("司机姓名")]
            [Required(ErrorMessage = "司机姓名不能为空")]
            [StringLength(18, ErrorMessage = "司机邮箱长度不能超过18位")]
            public string DriverName { get; set; }

            [DisplayName("密码")]
            // [Required(ErrorMessage = "密码不能为空")]
            [StringLength(18, ErrorMessage = "密码长度不能超过18位")]
            public string Password { get; set; }

            [DisplayName("密保问题")]
            [StringLength(18, ErrorMessage = "密保问题不能超过18位")]
            public string Question { get; set; }

            [DisplayName("密保答案")]
            [StringLength(18, ErrorMessage = "密保答案长度不能超过18位")]
            public string Answer { get; set; }



            [DisplayName("司机照片")]
            //[Required(ErrorMessage = "车照片不能为空")]
            //[StringLength(18 , ErrorMessage = "车照片长度不能超过18位")]
            public string DriverImage { get; set; }

            [DisplayName("邮箱地址")]
            [Required(ErrorMessage = "用户的邮箱不能为空")]
            [RegularExpression(@"^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$", ErrorMessage = "请输入正确的Email格式\n示例：abc@123.com")]
            public string Email { get; set; }


            [DisplayName("性别")]
            //[Required(ErrorMessage = "车状态不能为空")]
            [StringLength(2, ErrorMessage = "司机性别长度不能超过2位")]
            public string Sex { get; set; }

            [DisplayName("年龄")]
            [Required(ErrorMessage = "用户年龄不能为空")]
            //[Range(typeof(System .Int32) , "1" , "100" , ErrorMessage = "用户年龄必须在1~100之间的整数")]
            public int Age { get; set; }


            [DisplayName("联系电话")]
            [Required(ErrorMessage = "联系电话不能为空")]
            [StringLength(18, ErrorMessage = "司机性别长度不能超过18位")]
            public string Telephone { get; set; }

            [DisplayName("家庭地址")]
            [Required(ErrorMessage = "家庭地址不能为空")]
            [StringLength(30, ErrorMessage = "家庭地址长度不能超过30位")]
            public string FamilyAddress { get; set; }


            [DisplayName("状态：空闲打勾")]
            //[StringLength(2 , ErrorMessage = "状态长度不能超过2位")]
            public int FreeOrBusy { get; set; }

            [DisplayName("是否负责人")]
            // [StringLength(2 , ErrorMessage = "长度不能超过2位")]
            public int IsManeger { get; set; }



            [DisplayName("驾驶证号")]
            [Required(ErrorMessage = "驾驶证号不能为空")]
            [StringLength(18, ErrorMessage = "驾驶证号长度不能超过18位")]
            public string DriverLinceId { get; set; }


            [DisplayName("驾照档案号")]
            [Required(ErrorMessage = "驾照档案号不能为空")]
            [StringLength(18, ErrorMessage = "驾照档案号长度不能超过18位")]
            public string LinceID { get; set; }

            [DisplayName("发证日期")]
            [Required(ErrorMessage = "发证日期不能为空")]
            public DateTime LinceStart { get; set; }

            [DisplayName("准驾车型")]
            [Required(ErrorMessage = "准驾车型不能为空")]
            [StringLength(18, ErrorMessage = "准驾车型长度不能超过18位")]
            public string LinceType { get; set; }



            [DisplayName("驾照年审日期")]
            [Required(ErrorMessage = "驾照年审日期不能为空")]
            public DateTime LincecheckTime { get; set; }

            [DisplayName("备注")]
            [StringLength(100, ErrorMessage = "备注长度不能超过100位")]
            public string Remark { get; set; }


        }
    }